package com.lz.yz.member.service;

import com.lz.yz.core.Service;
import com.lz.yz.member.entity.Account;
import com.lz.yz.member.enumeration.AccountField;

import javax.servlet.http.HttpServletRequest;


/**
 * Created by CodeGenerator on 2017/11/09.
 */
public interface AccountService extends Service<Account> {

    // 执行登录: token 过期一并更新
    Account doLogin(AccountField field, String accountStr, String password,String types);

    // 根据账号查询 Account
    Account getAccountByField(AccountField field, String account, String types);

    // 根据 Token 查询 Account
    Account getAccountByToken(String token);

    // 新增账号
    Integer addNewAccount(Account account);

    /**
     * 通过主键更新帐号
     * 清缓存
     * @param account
     * @return
     */
    Integer updateByIdSelective(Account account);

    int getAccountIdByRequest(HttpServletRequest request);
}
